#ifndef TCPSERVER_H
#define TCPSERVER_H

#include <QWidget>
#include <QtNetwork>
#include <QTcpServer>
#include <QTcpSocket>

namespace Ui {
class tcpserver;
}

class tcpserver : public QWidget
{
    Q_OBJECT

public:
    explicit tcpserver(QWidget *parent = nullptr);
    ~tcpserver();

    void SetPort(int port = 8086);

    QString qstr;
    QString ipaddr;
    qint16 s_port;

private:
    Ui::tcpserver *ui;

    QTcpServer *tcpServer;
    QTcpSocket *tcpSocket;

signals:
    void sendsignal();
    void connectsuccess();

public slots:
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
};

#endif // TCPSERVER_H
